/******************************************************************************/
/*      project Gray                                                          */
/*      Martin Robinson                                                       */
/*                                                                            */
/******************************************************************************/
package gray;

import util.observer.Trigger;
import java.math.BigDecimal;
import java.util.Date;

/**
 * abstract factory for gray interface
 * @author martin
 * @param <G>
 */
public interface Factory<G> {
    
  /**
   * swap frame from the main window
   * @param f as frame
   */
  public void swap(Frame<G> f);
  /****************************button****************************************/
  /**
   * button factory
   * @param observer as Observer
   * @param name as String
   * @param key as Character
   * @return Frame
   */
  public Frame<G> button(final Trigger observer, final String name, final Character key);
  /**
   * button factory with Message for the observer
   * @param observer as Observer
   * @param name as String
   * @param key as Character
   * @param msg as Object
   * @return Frame
   */
  public Frame<G> buttonWithMsg(final Trigger observer, final String name, final Character key, final Object msg);
  /**
   * button factory with validation
   * @param observer as Observer
   * @param name as String
   * @param key as Character
   * @param valid as Frame
   * @return Frame
   */
  public Frame<G> buttonValid(final Trigger observer, final String name, final Character key, final Frame<G> valid);
  /**
   * button factory with validation and a message for the observer
   * @param observer as Observer
   * @param name as String
   * @param key as Character
   * @param msg as Object
   * @param valid as Frame
   * @return Frame
   */
  public Frame<G> buttonValidWithMsg(final Trigger observer, final String name, final Character key, final Object msg, final Frame<G> valid);
  /***************************element****************************************/
  /**
   * title element , a bigger text element
   * @param txt as String
   * @return Frame
   */
  public Frame<G> elemTitle(final String txt);
  /**
   * big text area element factory
   * @param txt as String
   * @return Frame
   */
  public Frame<G> elemBigText(final String txt);
  /**
   * date element factory
   * @param date as java.util.Date
   * @return Frame
   */
  public Frame<G> elemDate(final Date date);
  /**
   * money element factory
   * @param num as BigDecimal
   * @return Frame
   */
  public Frame<G> elemMoney(final BigDecimal num);
  /**
   * text element factory
   * @param txt as String
   * @return Frame
   */
  public Frame<G> elemText(final String txt);
  /**
   * time element factory
   * @param hour as java.util.Date
   * @return Frame
   */
  public Frame<G> elemTime(final Date hour);
  /**
   * integer element factory
   * @param num as String
   * @return Frame
   */
  public Frame<G> elemString(final String num);
  /**
   * percentage element factory
   * @param num as BigDecimal
   * @return Frame
   */
  public Frame<G> elemPercentage(final BigDecimal num);
  /***************************frame******************************************/
  /**
   * frame with bottom part factory
   * @param _bottom as Frame
   * @param _rest as Frame
   * @return Frame
   */
  public Frame<G> frameBottom(final Frame<G> _bottom, final Frame<G> _rest);
  /**
   * frame with top part Factory
   * @param _top as Frame
   * @param _rest as Frame
   * @return Frame
   */
  public Frame<G> frameTop(final Frame<G> _top, final Frame<G> _rest);
  /**
   * frame with left part factory
   * @param _left as Frame
   * @param _rest as Frame
   * @return Frame
   */
  public Frame<G> frameLeft(final Frame<G> _left, final Frame<G> _rest);
  /**
   * frame with right part factory
   * @param _right as Frame
   * @param _rest as Frame
   * @return Frame
   */
  public Frame<G> frameRight(final Frame<G> _right, final Frame<G> _rest);
  /**
   * list frame factory
   * @param lst as Frame[] array
   * @return Frame
   */
  public Frame<G> frameList(final Frame<G> ... lst);
  /**
   * split frame factory
   * @param left as Frame
   * @param right as Frame
   * @return Frame
   */
  public Frame<G> frameSplit(final Frame<G> left, final Frame<G> right);
  /**
   * raw frame factory
   * @param lst as Frame
   * @return Frame
   */
  public Frame<G> frameRaw(final Frame<G> ... lst);
  /**************************field*******************************************/
  /**
   * text area 
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldBigText(final String name, final Character key);
  /**
   * checkbox factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<Boolean,G> fieldCheckBox(final String name, final Character key);
  /**
   * combobox factory
   * @param name as String
   * @param lst as String[] array
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldComboBox(final String name, final String [] lst, final Character key);
  /**
   * date field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<Date,G> fieldDate(final String name, final Character key);
  /**
   * money field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<BigDecimal,G> fieldMoney(final String name, final Character key);
  /**
   * radio button group generator factory
   * @param <E> as Enum<enumobj>
   * @param title as String
   * @param enumData as preselected enumvalue
   * @return Field
   */
  public <E extends Enum<E>> Field<Enum<E>,G> fieldRadio(final String title, Class <E> enumData, final Character[] key);
  /**
   * text field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldText(final String name, final Character key);
  /**
   * time field factory
   * @param name as name
   * @param key as Character
   * @return Field
   */
  public Field<Date,G> fieldTime(final String name, final Character key);
  /**
   * percentage field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<BigDecimal,G> fieldPercentage(final String name, final Character key);
  /**
   * integer field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<Integer,G> fieldInteger(final String name, final Character key);
  /**
   * person name field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldName(final String name, final Character key);
  /**
   * street adresse field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldAdresse(final String name, final Character key);
  /**
   * postal code field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldCP(final String name, final Character key);
  /**
   * telephone field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldTelephone(final String name, final Character key);
  /**
   * www url field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldUrl(final String name, final Character key);
  /**
   * Email address field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldEmail(final String name, final Character key);
  /***********************required field*************************************/
  /**
   * required date field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<Date,G> fieldDateRequired(final String name, final Character key);
  /**
   * required money field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<BigDecimal,G> fieldMoneyRequired(final String name, final Character key);
  /**
   * required text field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldTextRequired(final String name, final Character key);
  /**
   * required time field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<Date,G> fieldTimeRequired(final String name, final Character key);
  /**
   * required percentage field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<BigDecimal,G> fieldPercentageRequired(final String name, final Character key);
  /**
   * required integer field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<Integer,G> fieldIntegerRequired(final String name, final Character key);
  /**
   * person name field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldNameRequired(final String name, final Character key);
  /**
   * street adresse field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldAdresseRequired(final String name, final Character key);
  /**
   * postal code field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldCPRequired(final String name, final Character key);
  /**
   * telephone field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldTelephoneRequired(final String name, final Character key);
  /**
   * www url field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldUrlRequired(final String name, final Character key);
  /**
   * Email address field factory
   * @param name as String
   * @param key as Character
   * @return Field
   */
  public Field<String,G> fieldEmailRequired(final String name, final Character key);
}
